/*
 * @Author: HZK
 * @Date: 2020-11-30 15:35:16
 * @LastEditTime: 2020-12-08 18:44:30
 * @LastEditors: hanfengmi
 * @Description: 路由配置
 */
import React from 'react';
import { Router, Route, Switch, Redirect } from 'dva/router';
import App from './src/layout/index';
import Log from './src/layout/Log';
import Home from './src/containers/home';
import Demo from './src/containers/demo';
import Table from './src/containers/table';
import NoMatch from './src/layout/NoMatch'

function RouterConfig({ history }) {
  return (
    <Router history={history}>
      <Switch>
          <Route exact path="/">
            <Redirect to="/login" />
        </Route>
        <Route exact path='/login'><Log /></Route>
        <Route exact path='/home-1'><App><Home num={2} /></App></Route>
        <Route exact path='/demo-2'><App><Demo /></App></Route>
        <Route exact path='/other-3'><App><Table /></App></Route>
        <Route path='*' component={NoMatch} />
      </Switch>
    </Router>
  );
}

export default RouterConfig;